package com.testfileupload.uploadimg.design.combination.definesafe;

import java.util.ArrayList;

//树枝构件
public class Composite extends Componet {
    //构件容器
    private ArrayList<Componet> componets = new ArrayList<>();

    //增加一个叶子
    public void add(Componet componet) {
        this.componets.add(componet);
    }

    //删除
    public void delete(Componet componet) {
        this.componets.remove(componet);
    }

    //获取
    public ArrayList<Componet> getChild() {
        return this.componets;
    }
}
